import http from './request'
export const login = (data) => {
    return http({
        url: '/hongyun-user/admin/login',
        method: 'POST',
        data
    })
}
export const loginOut = (userName) => {
    return http({
        url: '/hongyun-user/admin/exitUser?userName='+userName,
        method: 'GET',
    })
}
/**
 * 重置密码
 */
 export const resetPasswords = (data) => {
    return http({
        url: '/hongyun-user/admin/resetPasswords',
        method: 'POST',
        data
    })
}
/**
 * 获取用户信息
 */
 export const getAdminUser = (data) => {
    return http({
        url: '/hongyun-user/admin/getAdminUser',
        method: 'POST',
        data
    })
}
/**
 * 删除用户信息
 */
 export const deleteUser = (id) => {
    return http({
        url: `/hongyun-user/admin/deleteUser/${id}`,
        method: 'DELETE',
    })
}
/**
 * 新建或者编辑用户
 */
 export const operateAdminUser = (data) => {
    return http({
        url: '/hongyun-user/admin/operateAdminUser',
        method: 'POST',
        data
    })
}
/**
 * 查看个人信息
 */
 export const findMyInformation = (userName) => {
    return http({
        url: '/hongyun-user/admin/findMyInformation?userName='+userName,
        method: 'GET',
    })
}
//获取验证码
export const getVerifyCode = (data) => {
    return http({
        url: '/hongyun-user/verify/getVerifyCode',
        method: 'POST',
        data
    })
}
//校验验证码
export const examineVcode = (data) => {
    return http({
        url: '/hongyun-user/verify/examineVcode',
        method: 'POST',
        data
    })
}
/*******************************************角色管理**************************************************** */
/**
 * 获取所有菜单列表
 */
 export const getMenuList = () => {
    return http({
        url: '/hongyun-user/role/getMenuList',
        method: 'GET',
    })
}
/**
 * 获取角色列表
 */
 export const getRoleAuthorityList = (data) => {
    return http({
        url: '/hongyun-user/role/getRoleAuthorityList',
        method: 'POST',
        data
    })
}
/**
 * 保存角色信息
 */
 export const operateRole = (data) => {
    return http({
        url: '/hongyun-user/role/operateRole',
        method: 'POST',
        data
    })
}
/**
 * 删除角色信息
 */
 export const deleteRole = (id) => {
    return http({
        url: `/hongyun-user/role/deleteRole/${id}`,
        method: 'DELETE',
    })
}

/***********************************数据字典*************************************** */
//删除数据字典
export const deleteDataDictionary = (id) => {
    return http({
        url: `/hongyun-training/workSystem/deleteDataDictionary/${id}`,
        method: 'DELETE',
    })
}
//添加数据字典
export const operateDataDictionary = (data) => {
    return http({
        url: '/hongyun-training/workSystem/operateDataDictionary',
        method: 'POST',
        data
    })
}
//获取数据字典列表数据
export const getDataDictionaryParent = (data) => {
    return http({
        url: '/hongyun-training/workSystem/getDataDictionaryParent',
        method: 'POST',
        data
    })
}
/*******************************************成员和部门************************************************** */
//获取所有的部门树结构
export const getCompany = () => {
    return http({
        url: '/hongyun-user/company/getCompany',
        method: 'GET',
    })
}
//编辑部门名称
export const operateCompany = (data) => {
    return http({
        url: '/hongyun-user/company/operateCompany',
        method: 'POST',
        data
    })
}
//上移
export const operateCompanyOrder = (id) => {
    return http({
        url: '/hongyun-user/company/operateCompanyOrder?id='+id,
        method: 'GET',
    })
}
//删除
export const deleteCompany = (id) => {
    return http({
        url: `/hongyun-user/company/deleteCompany/${id}`,
        method: 'DELETE',
    })
}
//获取部门人数
export const companyPeopleNum = () => {
    return http({
        url: '/hongyun-user/company/companyPeopleNum',
        method: 'GET',
    })
}
//部門下人員列表
export const getUsersByCompanyId = (data) => {
    return http({
        url: '/hongyun-user/company/getUsersByCompanyId',
        method: 'POST',
        data
    })
}
//新增部门提交
// export const operateCompany = (data) => {
//     return http({
//         url: '/hongyun-user/company/operateCompany',
//         method: 'POST',
//         data
//     })
// }
//设置主管
export const setPrincipalUserId = (companyId,userId) => {
    return http({
        url: '/hongyun-user/company/setPrincipalUserId?companyId='+companyId+'&userId='+userId,
        method: 'GET',
    })
}
//查看所有人员列表
export const getUserList = (companyId) => {
    return http({
        url: '/hongyun-user/user/getUserList?companyId='+companyId,
        method: 'GET',
    })
}
export const getUserList_ = () => {
    return http({
        url: '/hongyun-user/user/getUserList',
        method: 'GET',
    })
}
//获取人员以及委外所有人员列表
export const getJobAllUsers = () => {
    return http({
        url: '/hongyun-user/jobOutsource/getJobAllUsers',
        method: 'GET',
    })
}
export const getUserById = (id) => {
    return http({
        url: '/hongyun-user/user/getUserById?id='+id,
        method: 'GET',
    })
}
export const getUserByIdAndCompanyId = (id,companyId) => {
    return http({
        url: '/hongyun-user/user/getUserByIdAndCompanyId?id='+id+"&companyId"+companyId,
        method: 'GET',
    })
}
//获取角色列表
export const getRoleList = () => {
    return http({
        url: '/hongyun-user/role/getRoleList',
        method: 'GET',
    })
}
//获取所有的部门
export const getCompanyList = () => {
    return http({
        url: '/hongyun-user/company/getCompanyList',
        method: 'GET',
    })
}
//管理员重置密码
export const adminResetPasswords = (id) => {
    return http({
        url: '/hongyun-user/admin/adminResetPasswords?id='+id,
        method: 'GET',
    })
}

/*************************************成员与证书************************************************ */
export const certificateList = (data) => {
    return http({
        url: '/hongyun-training/certificate/certificateList',
        method: 'POST',
        data
    })
}
//删除成员证书
export const deleteCertificate = (id) => {
    return http({
        url: `/hongyun-training/certificate/deleteCertificate/${id}`,
        method: 'DELETE',
    })
}
//获取八大作业
export const getEightWorkType = () => {
    return http({
        url: '/hongyun-training/common/getEightWorkType',
        method: 'GET',
    })
} 
//编辑提交表单
export const operateCertificate = (data) => {
    return http({
        url: '/hongyun-training/certificate/operateCertificate',
        method: 'POST',
        data
    })
}
/******************************审批模板********************************* */
export const getWorkTemplate = (id) => {
    return http({
        url: '/hongyun-training/approve/getWorkTemplate?companyId='+id,
        method: 'GET',
    })
} 
//新增编辑模板
export const operateWorkTemplate = (data) => {
    return http({
        url: '/hongyun-training/approve/operateWorkTemplate',
        method: 'POST',
        data
    })
}
//删除审批模板
export const deleteWorkTemplate = (id) => {
    return http({
        url: `/hongyun-training/approve/deleteWorkTemplate/${id}`,
        method: 'DELETE',
    })
}
/******************************公告********************************* */
export const sysnoticeList = (data,current,size) => {
    return http({
        url: '/hongyun-training/sysnotice/list?current='+current+'&size='+size,
        method: 'POST',
        data
    })
} 
//新增编辑模板
export const sysnoticesubmit = (data) => {
    return http({
        url: '/hongyun-training/sysnotice/submit',
        method: 'POST',
        data
    })
}
//删除
export const sysnoticeremove = (id) => {
    return http({
        url: '/hongyun-training/sysnotice/remove?ids='+id,
        method: 'POST',
    })
}
//日志
export const getLogs = (data) => {
    return http({
        url: '/hongyun-training/systemlog/getLogs',
        method: 'POST',
        data
    })
}
/************************************部门与用户**************************************** */
//获取部门的根目录
export const getDepartmentList = () => {
    return http({
        url: '/hongyun-user/department/getDepartmentList',
        method: 'GET',
    })
}
//获取子部门列表
export const getChildDepartments = (id) => {
    return http({
        url: '/hongyun-user/department/getChildDepartments?deptId='+id,
        method: 'GET',
    })
}
//获取部门列表
export const getDepartments = () => {
    return http({
        url: '/hongyun-user/department/getDepartments',
        method: 'GET',
    })
}
//获取公司及部门人数
export const getUserCount = (id) => {
    return http({
        url: '/hongyun-user/department/getUserCount?deptId='+id,
        method: 'GET',
    })
}
//获取部门与用户列表
export const getUsers = (data) => {
    return http({
        url: '/hongyun-user/department/getUsers',
        method: 'POST',
        data
    })
}
//功能权限
export const setUserBindRole = (data) => {
    return http({
        url: '/hongyun-user/department/setUserBindRole',
        method: 'POST',
        data
    })
}
//数据权限
export const setUserBindAuthority = (data) => {
    return http({
        url: '/hongyun-user/department/setUserBindAuthority',
        method: 'POST',
        data
    })
}
//解除绑定
export const unbindUser = (id) => {
    return http({
        url: '/hongyun-user/admin/unbindUser?id='+id,
        method: 'GET',
    })
}
//获取角色列表
// export const getRoleList = () => {
//     return http({
//         url: '/role/getRoleList',
//         method: 'GET',
//     })
// }
//查询用户
export const getUserInfo = (userSearch) => {
    return http({
        url: '/hongyun-user/department/getUserInfo?userSearch='+userSearch,
        method: 'GET',
    })
}
//重置密码
// export const adminResetPasswords = (userName) => {
//     return http({
//         url: '/admin/adminResetPasswords?userName='+userName,
//         method: 'GET',
//     })
// }
//根据部门获取用户信息
export const getUserData = (id) => {
    return http({
        url: '/hongyun-user/user/getUserByIdAndCompanyId?companyId='+id,
        method: 'GET',
    })
}
/******************************数据权限********************************* */
//获取数据
export const systemdataauthorityList= (data, current, size) => {
    return http({
        url: '/api/systemdataauthority/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
//提交
export const systemdataauthoritySubmit = (data) => {
    return http({
        url: '/api/systemdataauthority/submit',
        method: 'POST',
        data: data
    })
}
// 逻辑删除
export const systemdataauthorityRemove = (ids) => {
    return http({
        url: `/api/systemdataauthority/remove?ids=${ids}`,
        method: 'POST'
    })
}
//获取部门
export const getDeptTree = (id) => {
    return http({
        url: '/api/department/getDeptTree?userId='+id,
        method: 'GET',
    })
}
//获取所有部门
export const getAllDeptTree = () => {
    return http({
        url: '/api/department/getDeptTree',
        method: 'GET',
    })
}
//根据部门id获取人员列表
export const getDeptTreeUsers = (data) => {
    return http({
        url: '/api/user/getUsers',
        method: 'POST',
        data: data
    })
}
//获取所有的单位列表
export const getJobAllDept = () => {
    return http({
        url: '/api/jobOutsource/getJobAllDept',
        method: 'GET',
    })
}
/**************************************一张图配置************************************************* */
//一张图配置
//获取数据
export function bigScreenSettingList(data, current, size){
    return http({
        url: '/api/bigScreenSetting/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
//码头数据提交
export const lpgUpdate = (data) => {
    return http({
        url: '/api/bigScreenSetting/lpgUpdate',
        method: 'POST',
        data: data
    })
}
//单条数据提交
export const bigscreenupdate = (data) => {
    return http({
        url: '/api/bigScreenSetting/update',
        method: 'POST',
        data: data
    })
}
/**************************************安全违规记录************************************************* */
export function securityviolationsList(data, current, size){
    return http({
        url: '/api/securityviolations/list?current=' + current + '&size=' + size,
        method: 'POST',
        data
    })
}
// 数据提交
export const securityviolationsupdate = (data) => {
    return http({
        url: '/api/securityviolations/submit',
        method: 'POST',
        data: data
    })
}
// 逻辑删除
export const securityviolationsRemove = (ids) => {
    return http({
        url: `/api/securityviolations/remove?ids=${ids}`,
        method: 'POST'
    })
}
/**************************************年度计划吞吐量************************************************* */
export function getVolumeList(data){
    return http({
        url: '/api/picture/getVolumeList',
        method: 'POST',
        data
    })
}
// 数据提交
export const operateVolume = (data) => {
    return http({
        url: '/api/picture/operateVolume',
        method: 'POST',
        data: data
    })
}
// 逻辑删除
export const delVolume = (id) => {
    return http({
        url: `/api/picture/delVolume/${id}`,
        method: 'DELETE'
    })
}
/**************************************货物亏损率************************************************* */
export function getLossList(data){
    return http({
        url: '/api/picture/getLossList',
        method: 'POST',
        data
    })
}
// 数据提交
export const operateLoss = (data) => {
    return http({
        url: '/api/picture/operateLoss',
        method: 'POST',
        data: data
    })
}
// 逻辑删除
export const delLoss = (id) => {
    return http({
        url: `/api/picture/delLoss/${id}`,
        method: 'DELETE'
    })
}
/**************************************客户满意度************************************************* */
export function getSatisfyList(data){
    return http({
        url: '/api/picture/getSatisfyList',
        method: 'POST',
        data
    })
}
// 数据提交
export const operateSatisfy = (data) => {
    return http({
        url: '/api/picture/operateSatisfy',
        method: 'POST',
        data: data
    })
}
// 逻辑删除
export const delSatisfy = (id) => {
    return http({
        url: `/api/picture/delSatisfy/${id}`,
        method: 'DELETE'
    })
}
/**************************************创纪录展示************************************************* */
export function getRecordsList(data){
    return http({
        url: '/api/picture/getRecordsList',
        method: 'POST',
        data
    })
}
// 数据提交
export const operateRecords = (data) => {
    return http({
        url: '/api/picture/operateRecords',
        method: 'POST',
        data: data
    })
}
// 逻辑删除
export const delRecords = (id) => {
    return http({
        url: `/api/picture/delRecords/${id}`,
        method: 'DELETE'
    })
}